from django.conf.urls import url
from rest_framework import routers

from . import views

urlpatterns = [
    url(r'permission/content_types/$', views.PermissionView.as_view({
        'get': 'content_types',
    })),
    url(r'permission/simple/$', views.GroupView.as_view({
        'get': 'simple',
    })),
    url(r'permission/groups/simple/$', views.AdminView.as_view({
        'get': 'simple',
    })),

]

perms_router = routers.DefaultRouter()
perms_router.register(r'permission/perms', views.PermissionView, base_name='permission_viewset')
groups_router = routers.DefaultRouter()
groups_router.register(r'permission/groups', views.GroupView, base_name='group_viewset')
admin_router = routers.DefaultRouter()
admin_router.register(r'permission/admins', views.AdminView, base_name='admin_viewset')

urlpatterns += perms_router.urls
urlpatterns += groups_router.urls
urlpatterns += admin_router.urls
print(urlpatterns)
